var express = require('express');
var router = express.Router();

var { request } = require('../utils/request');

const BASE_URL  = 'http://v3.wufazhuce.com:8000';

/* GET home page. */
// router.get('/', function(req, res, next) {
//   res.render('index', { title: 'Express' });
// });

router.get('/', function(req, res) {
  // console.log(req);
  // request('/api/hp/idlist/0');
  // console.log('posted request!!');
  // res.send('Hello, World. [by index.js]');
  // request('/api/hp/idlist/0', data => {
  //   res.send(data);
  // });
  request(`${BASE_URL}/api/hp/idlist/0`).then(data => {
    res.send(data);
  });
});

module.exports = router;
